/*************************************************************************
> File Name: queue_test.cc
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2024-09-12 08:26:29
> Description: 队列测试
************************************************************************/

#include <iostream>
#include <queue>
#include <list>
#include <deque>

int main()
{
std:
    list<int> list;

    std::queue<int> q;
    q.push(1);
    q.push(2);
    q.push(3);
    q.push(4);
    q.push(5);
    q.push(6);
    std::cout << "sizeof(std::queue) :0x" << std::hex << sizeof(std::queue<int>) << std::endl;
    std::cout << "queue size: " << q.size() << std::endl;

    std::deque<int> d;
    d.push_back(1);
    d.push_back(2);
    d.push_back(3);
    d.push_back(4);
    d.push_back(5);
    std::cout << "sizeof(std::deque) :0x" << std::hex << sizeof(std::deque<int>) << std::endl;
    std::cout << "deque size: " << d.size() << std::endl;

    /*
    _M_last = _M_first + difference_type(_S_buffer_size());

     static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT
     {
         return __deque_buf_size(sizeof(_Tp));
     }

    #define _GLIBCXX_DEQUE_BUF_SIZE 512
    __deque_buf_size(size_t __size)
    { return (__size < _GLIBCXX_DEQUE_BUF_SIZE
         ? size_t(_GLIBCXX_DEQUE_BUF_SIZE / __size) : size_t(1)); }
     */
}
